package java_jc_cs;

import java.util.Random;

public class _103{
    void examine(){
        My me=My.getme();
        me.learn("java单例模式");
        me.learn("java多例模式");
        me.learn("java中枚举的使用");
    }
}
class My{
    static final My me=new My();
    String name="HZY";
    String sex ="男";
    int age=22;
    private  My(){}

    public static My getme() {
        return me;
    }
    boolean learn( String course){
        if (new Random().nextBoolean()){
            System.out.println(me.name+" 学会了 "+course);
            return true;
        }else {
            System.out.println(me.name+" 没学会 "+course);
            return false;
        }
    }
}
